package cn.zcy.domain;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

public class User {
    private Integer id;

    private String username;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    private Double moeny;
    @NotEmpty(message = "邮箱地址必须输入！")
    @Email(message = "请输入正确的邮箱格式！")
    private String email;
    @NotEmpty(message = "密码不能为空！")
    private String password;

    public User() {
    }

    public User(Integer id, String username, Date birthday, Double moeny, String email, String password) {
        this.id = id;
        this.username = username;
        this.birthday = birthday;
        this.moeny = moeny;
        this.email = email;
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Double getMoeny() {
        return moeny;
    }

    public void setMoeny(Double moeny) {
        this.moeny = moeny;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", birthday=" + birthday +
                ", moeny=" + moeny +
                ", email='" + email + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
